/* $Id: SingleClientPersonDomainObjectManager.java 
 * Copyright (C) 2011, TRAKHEES
 *  
 * Revision History
 *
 * Date  			Author 		    	Remarks
 * ---------------------------------------------------------------------------------
 *
 */
package ae.pcfc.etks.online.common.domain.manager;

import java.util.List;
import java.util.Map;

import ae.pcfc.etks.online.common.domain.ClientPersonReq;
import ae.pcfc.etks.online.common.domain.TTscClientCategory;
import ae.pcfc.etks.online.common.domain.TTscClientPerson;
import ae.pcfc.etks.online.common.domain.TTscLicType;
import ae.pcfc.etks.online.common.exception.LookupException;
import ae.pcfc.etks.online.common.exception.PersistenceException;
import ae.pcfc.etks.online.common.vo.ClientNameVO;
import ae.pcfc.etks.online.common.vo.SCClientPersonRoleVO;
import ae.pcfc.etks.online.common.vo.SearchCriteriaPersonVO;
import ae.pcfc.etks.online.common.vo.TrakheesIdAndPINVO;
import ae.pcfc.etks.online.common.vo.TrakheesIdVO;

public interface SingleClientPersonDomainObjectManager extends
		BaseDomainObjectManager {
	
	/**
	 * add
	 * Method to add client person request
	 * @param clientPersonReq
	 * @return
	 * @throws PersistenceException
	 * Map<String,String>
	 */
	public Map<String, String> add(ClientPersonReq clientPersonReq)  throws PersistenceException;
	
	/**
	 * validateTrakheesIdAndPIN
	 * Method to validate trakhees id and pin combination
	 * @param idAndPINVO
	 * @return
	 * @throws LookupException
	 * boolean
	 */
	public boolean validateTrakheesIdAndPIN(TrakheesIdAndPINVO idAndPINVO)  throws LookupException;
	
	/**
	 * findSCPersonByTrakheesId
	 * Method to find client person domain object by trakhees id
	 * @param trakheesId
	 * @return
	 * @throws LookupException
	 * TTscClientPerson
	 */
	public TTscClientPerson findSCPersonByTrakheesId(String trakheesId) throws LookupException;
	
	/**
	 * findSCPersonRoleByTrakheesId
	 * Method to find client person roles associated with a client (trakhees id)
	 * @param trakheesId
	 * @return
	 * @throws LookupException
	 * List<SCClientPersonRoleVO>
	 */
	public List<SCClientPersonRoleVO> findSCPersonRoleByTrakheesId(String trakheesId)  throws LookupException;
	
	/**
	 * addSCPersonRole
	 * Method to add client person role
	 * @param roleId
	 * @param trakheesId
	 * @param strUserName
	 * @throws PersistenceException
	 * void
	 */
	public void addSCPersonRole(Long roleId, String trakheesId, String strUserName) throws PersistenceException;
	
	/**
	 * findSCTrakheesIdsByRoleId
	 * Method to find the list of client (trakhees ids) associated with a role (role id)
	 * @param roleId
	 * @return
	 * @throws LookupException
	 * List<TrakheesIdVO>
	 */
	public List<TrakheesIdVO> findSCTrakheesIdsByRoleId(String roleId)  throws LookupException;	
	
	/**
	 * validateClientName
	 * Method to validate client name
	 * @param clientNameVO
	 * @return
	 * @throws LookupException
	 * boolean
	 */
	public boolean validateClientName(ClientNameVO clientNameVO)  throws LookupException;
	
	/**
	 * findTrakheesIdAndPinByEmail
	 * Method to find trakhees id and pin combination based on client's email address
	 * @param email
	 * @return
	 * @throws LookupException
	 * TrakheesIdAndPINVO
	 */
	public TrakheesIdAndPINVO findTrakheesIdAndPinByEmail(String email)  throws LookupException;
	
	/**
	 * getClientCategory
	 * Method to get list of client categories based on client type
	 * @param clientType
	 * @return
	 * @throws LookupException
	 * List<TTscClientCategory>
	 */
	public List<TTscClientCategory> getClientCategory(String clientType) throws LookupException;
	
	/**
	 * getClientCategoryById
	 * Method to get client category by category id
	 * @param categoryId
	 * @return
	 * @throws LookupException
	 * TTscClientCategory
	 */
	public TTscClientCategory getClientCategoryById(String categoryId) throws LookupException;
	
	/**
	 * getClientLicenseTypeByCode
	 * Method to get client license type by license type code
	 * @param licenseTypeCode
	 * @return
	 * @throws LookupException
	 * TTscLicType
	 */
	public TTscLicType getClientLicenseTypeByCode(String licenseTypeCode) throws LookupException;
	
	/**
	 * searchPerson
	 * Method to search client persons based on search criteria
	 * @param searchCriteriaPersonVO
	 * @return
	 * @throws LookupException
	 * List<TTscClientPerson>
	 */
	public List<TTscClientPerson> searchPerson(SearchCriteriaPersonVO searchCriteriaPersonVO) throws LookupException;

	/**
	 * removeSCPersonRole
	 * Method to add client person role
	 * @param roleId
	 * @param trakheesId
	 * @param strUserName
	 * @throws PersistenceException
	 * void
	 */
	public void removeSCPersonRole(Long roleId, String cTrakheesId, String strUserName);

	public void undoCreatePerson(ClientPersonReq clientPersonReq,String strTrakheesId, String clientStatus);	
}
